package com.yjd.pub.settlement.dao.impl;

import org.springframework.stereotype.Component;
import com.yjd.comm.base.dao.impl.BaseDaoImpl;
import com.yjd.comm.settlement.model.ClearDayDetailModel;
import com.yjd.pub.settlement.dao.IClearDayDetailDao;

import java.util.List;
import java.util.Map;

/**
 * <b>description</b>：日结算明细数据访问层 <br>
 * <b>time</b>：2017-08-11 17:27:54 <br>
 * <b>author</b>： yangchangyan@yijiedai.com
 */
@Component("clearDayDetailDao")
public class ClearDayDetailDaoImpl extends BaseDaoImpl implements IClearDayDetailDao {

	private static final String SQLMAPNAMESPACE = ClearDayDetailModel.class.getName();
	private static final String PKNAME = "id";

	/**
	 * 统计平台日结金额
	 *
	 * @param param
	 * @return
	 * @throws Exception
	 */
	@Override
	public Double statisticsPfPrice(Map param) throws Exception {
		return (Double)this.getSqlMap(true).queryForObject(this.getStatement("statisticsPfPrice"),param);
	}

	/**
	 * 统计平台日结 笔数
	 *
	 * @param param
	 * @return
	 * @throws Exception
	 */
	@Override
	public int statisticsPfNum(Map param) throws Exception {
		return (Integer) this.getSqlMap(true).queryForObject(this.getStatement("statisticsPfNum"),param);
	}

	@Override
	public List querySettlementDetail(Map<Object, Object> paramMap, boolean write) throws Exception {
		return this.getSqlMap(write).queryForList(this.getStatement("querySettlementDetail"), paramMap);
	}

	@Override
	public String getPrimaryKeyName() {
		return PKNAME;
	}

	@Override
	public String getSqlmapNamespace() {
		return SQLMAPNAMESPACE;
	}
	
}
